﻿<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:NanoMvvm="clr-namespace:NanoMvvm" x:Class="NanoMvvm.Views.Default.Dialogs.SelectionDialogWindow" 
        WindowStartupLocation="CenterScreen"
        mc:Ignorable="d" Title="{Binding Header}" NanoMvvm:ViewManager.ShowType="Modal" ShowInTaskbar="False" ResizeMode="NoResize" SizeToContent="WidthAndHeight" MaxWidth="700" MinHeight="150" MinWidth="200"
        d:DataContext="{d:DesignInstance NanoMvvm:SelectionDialogViewModel, IsDesignTimeCreatable=True}" Topmost="True" WindowStyle="None">
    <StackPanel>
        <TextBlock TextWrapping="Wrap" Text="{Binding Header}" Margin="5" FontWeight="Bold"/>
        <Border BorderBrush="Black" MinHeight="80">
            <TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Message}" Margin="15"/>
        </Border>
        <ItemsControl x:Name="selectionItemsControl" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" ItemsSource="{Binding Items}" ItemTemplate="{DynamicResource ItemTemplate}" ItemsPanel="{DynamicResource ItemsPanelTemplate1}">
            <ItemsControl.Resources>
                <DataTemplate x:Key="ItemTemplate">
                    <Button x:Name="button" Content="{Binding Header}" Margin="10" Padding="3" MinWidth="65" Command="{Binding Command}" CommandParameter="{Binding Header}"/>
                </DataTemplate>
                <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
                    <NanoMvvm:AlignableWrapPanel HorizontalContentAlignment="Center"/>
                </ItemsPanelTemplate>
            </ItemsControl.Resources>
        </ItemsControl>
    </StackPanel>
</Window>
